<style>
div.form div.fields div.field div.label { left:80px; }
div.form div.fields div.field div.label { left:16px !important; padding:0px !important; }
input.input-mini { width:50px; }
div.form div.fields div.field div.input select { padding:6px; }
fieldset { border:1px dotted #DDDDDD; padding:10px; margin:10px 0; }
fieldset legend { font-weight:bold; }
fieldset .label { margin-left:10px !important; }
#footer { z-index:1; }
.dhx_tabbar_zone_top .dhx_tab_element { padding-top:6px !important; }
</style>

<link href="<?php echo base_url('/assets/js/dhtmlx/dhtmlxTabbar/dhtmlxtabbar.css') ?>" rel="stylesheet" />
<script  src="<?php echo base_url('assets/js/dhtmlx/dhtmlxcommon.js') ?>"></script>
<script  src="<?php echo base_url('/assets/js/dhtmlx/dhtmlxTabbar/dhtmlxtabbar.js') ?>"></script>

<div class="box">

	<div class="title">
		<h5>Site Info</h5>
	</div>

	<!-- start:siteInfo -->
	<div id="siteInfo" style="width:100%; height:100px;">
		<!-- start:contentGeneralInfo -->
		<div id="contentGeneralInfo">
			
			<div class="form">
				<div class="fields">
					
					<div class="field">
						<div class="label">
							<label for="oldSiteId">Old Site ID</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['old_site_id']) ?></div>					  
					</div>
					
					<div class="field">
						<div class="label">
							<label for="siteName">Site Name</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['site_name']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="siteType">Site Type</label>
						</div>
						<div class="input">
							<?php
							$site_type = get_instance()->core->view_row('t_mtr_site_type', array('type_id' => $general_info['site_type']));
							echo nbsp(@$site_type['site_type_name']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="siteProfile">Site Profile</label>
						</div>
						<div class="input">
							<?php
							$site_profile = get_instance()->core->view_row('t_mtr_site_profile', array('profile_id' => $general_info['site_profile']));
							echo nbsp(@$site_profile['descr']);
							?>
						</div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="siteLocationLat">Latitude</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['latitude']) ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="siteLocationLng">Longitude</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['longitude']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="siteAddress">Site Address</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['site_address']) ?></div>
					</div>
					
					<div class="field">						   
						<div class="label">
							<label for="propinsi">Propinsi</label>
						</div>
						<div class="input">
							<?php
							$propinsi = get_instance()->core->view_row('t_mtr_propinsi', array('propinsi_id' => $general_info['propinsi']));
							echo nbsp(@$propinsi['descr']);
							?>
						</div>		
					</div>
					
					<div class="field">						   
						<div class="label">
							<label for="kabupaten">Kabupaten</label>
						</div>
						<div class="input">
							<?php
							$kabupaten = get_instance()->core->view_row('t_mtr_kabupaten', array('kabupaten_id' => $general_info['kabupaten']));
							echo nbsp(@$kabupaten['descr']);
							?>
						</div>
					</div>
				  
					<div class="field">						   
						<div class="label">
							<label for="kecamatan">Kecamatan</label>
						</div>
						<div class="input">
							<?php
							$kecamatan = get_instance()->core->view_row('t_mtr_kecamatan', array('kecamatan_id' => (int) $general_info['kecamatan']));
							echo nbsp(@$kecamatan['descr']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="kelurahan">Kelurahan</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['kelurahan']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="kodePos">Kode Pos</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['kode_pos']) ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="name">Site Specification</label>
						</div>
						<div class="input">
							<?php
							$site_specification = get_instance()->core->view_row('t_mtr_site_specification', array('specification_id' => $general_info['site_specification']));
							echo nbsp(@$site_specification['descr']);
							?>
						</div>
					</div>
				  
					<div class="control-group" style="display:none">
						<label class="control-label" for="name">
							Cost Center
						</label>
						<div class="controls controls-row"><?php echo $general_info['cost_center'] ?></div>
					</div>
				  
				  <div class="control-group" style="display:none">
					<label class="control-label" for="name">
					  Branch
					</label>
					<div class="controls controls-row">
						<?php echo @form_input('branch', set_value('branch', $general_info['branch']), 'class="span6" placeholder="Surabaya" readonly="readonly"') ?>
					</div>
				  </div>
				  <div class="control-group" style="display:none">
					<label class="control-label" for="name">
					  Sub Branch
					</label>
					<div class="controls controls-row">
						<?php echo @form_input('subBranch', set_value('subBranch', $general_info['sub_branch']), 'class="span6" placeholder="Surabaya" readonly="readonly"') ?>
					</div>
				  </div>
				  
					<div class="field">
						<div class="label">
							<label for="cluster">Cluster</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['cluster']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="guardHouse">Guard House</label>
						</div>
						<div class="input"><?php echo $general_info['guard_house'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="24HourAccess">24 Hour Access</label>
						</div>
						<div class="input"><?php echo $general_info['24_hour_access'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="cmeInsured">CME Insured</label>
						</div>
						<div class="input"><?php echo $general_info['cme_insured'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="equipmentInsured">Equipment Insured</label>
						</div>
						<div class="input"><?php echo $general_info['equipment_insured'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="polisNumber">Polis Number</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['polis_number']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="cmePartnerName">CME Partner</label>
						</div>
						<div class="input">                            
							<?php
							$cmePartner = @get_instance()->core->view_row('t_mtr_cme_partner', array('cme_partner_id' => (int) $general_info['cme_partner']));
							echo nbsp(@$cmePartner['nama']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="picSmart">PIC Smart</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['pic_smart']) ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="phonePicSmart">Phone PIC Smart</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['phone1']) ?></div>
					</div>
				 
					<div class="field">
						<div class="label">
							<label for="picCmePartner">PIC CME Partner</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['pic_cme_partner']) ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="picCmePartner">Phone PIC CME Partner</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['phone2']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label">
							<label for="cutOverDate">Cut Over Date</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['cut_over_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label">
							<label for="verifiedOnAir">Verified On Air (PAT)</label>
						</div>
						<div class="input"><?php echo nbsp($general_info['verified_on_air']) ?></div>
					</div>
				  
				</div>
			</div>
			
		</div>
		<!-- end:contentGeneralInfo -->
		
		<!-- start:contentSiteKeepers -->
		<div id="contentSiteKeepers">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($site_keepers) { ?>
					
					<div class="field">
						<div class="label"><label for="name">Name</label></div>
						<div class="input"><?php echo nbsp($site_keepers['name']) ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="address">Address</label></div>
						<div class="input"><?php echo nbsp($site_keepers['address']) ?></div>
					</div>
					 
					<div class="field">
						<div class="label"><label for="phone">Phone</label></div>
						<div class="input"><?php echo nbsp($site_keepers['phone']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="salary">Salary /Month</label></div>
						<div class="input"><?php echo nbsp(number_format($site_keepers['salary_month'], 2)) ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="hiredBySmart">Hired Bye Smart</label></div>
						<div class="input"><?php echo $site_keepers['hired_by_smart'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="remark">Remark</label></div>
						<div class="input"><?php echo nbsp($site_keepers['remark']) ?></div>
					</div>
					
				</div>
				
				<?php } ?>
				
			</div>
		</div>
		<!-- end:contentSiteKeepers -->
		
		<!-- start:contentPLN -->
		<div id="contentPLN">
				
			<div class="form">
				<div class="fields">
					
					<?php if ($pln) { ?>
					
					<div class="field">
						<div class="label"><label for="handoverProject">Handover Project</label></div>
						<div class="input"><?php echo nbsp($pln['handover_project']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="handoverRemark">Handover Remark</label></div>
						<div class="input"><?php echo nbsp($pln['handover_remark']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="idPelangganPLN">ID Pelanggan PLN</label></div>
						<div class="input"><?php echo nbsp($pln['id_pelanggan_pln']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="atasNamaPelanggan">Atas Nama Pelanggan</label></div>
						<div class="input"><?php echo nbsp($pln['atas_nama_pelanggan']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="plnConnectedDate">PLN Connected Date</label></div>
						<div class="input"><?php echo nbsp($pln['pln_connected_date']) ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="namaUPJPLN">Nama UPJ PLN</label></div>
						<div class="input"><?php echo nbsp($pln['nama_upj_pln']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="woDismantleDate">WO Dismantle Date</label></div>
						<div class="input"><?php echo nbsp($pln['wo_dismantle_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="plnDisconnectDate">PLN Disconnect Date</label></div>
						<div class="input"><?php echo nbsp($pln['wo_dismantle_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="trafoBlast">Trafo Blast</label></div>
						<div class="input">
							<?php
							$trafoBlast = get_instance()->core->view_row('t_mtr_trafo', array('trafo_id' => $pln['trafo_blast']));
							echo nbsp(@$trafoBlast['nama']);
							?>
						</div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="trafoCapacity">Trafo Capacity</label></div>
						<div class="input">
							<?php
							$trafoCapacity = get_instance()->core->view_row('t_mtr_trafo_capacity', array('trafo_capacity_id' => $pln['trafo_capacity']));
							echo nbsp(@$trafoCapacity['nama']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="trafoMaintainedBySmartfren">Trafo Maintained by Smartfren</label></div>
						<div class="input"><?php echo $pln['trafo_maintained_by_smartfren'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="kwhType">KWH Type</label></div>
						<div class="input">                           
							<?php
							$kwhType = get_instance()->core->view_row('t_mtr_kwh_type', array('kwh_type_id' => $pln['kwh_type']));
							echo nbsp(@$kwhType['descr']);
							?>
						</div>		
					</div>
					
					<div class="field">
						<div class="label"><label for="plnPhase">PLN Phase</label></div>
						<div class="input"><?php echo nbsp($pln['pln_phase']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="plnCapacity">PLN Capacity (KVA)</label></div>
						<div class="input"><?php echo nbsp($pln['pln_capacity']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="tarifType">Tarif Type</label></div>
						<div class="input"><?php echo $pln['tarif_type'] == 1 ? 'Reguler' : 'Non-Reguler' ?></div>
					</div>
					
					<div class="field">
					   <div class="label"><label for="tarifName">Tarif Name</label></div>
						<div class="input">
							<?php
							$tarifName = get_instance()->core->view_row('t_mtr_tarif_name', array('tarif_name_id' => $pln['tarif_name']));
							echo nbsp(@$tarifName['nama']);
							?>
						</div>
					</div>
						
					<div class="field">
						<div class="label"><label for="caraPembayaran">Cara Pembayaran</label></div>
						<div class="input">
							<?php
							$caraPembayaran = get_instance()->core->view_row('t_mtr_cara_pembayaran', array('cara_pembayaran_id' => $pln['cara_pembayaran']));
							echo nbsp(@$caraPembayaran['descr']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="remarks">Remarks</label></div>
						<div class="input"><?php echo nbsp($pln['remarks']) ?></div>
					</div>
					
					<fieldset>  
						<legend>Genset</legend>
						
						<div class="field">
							<div class="label"><label for="permanentGenset">Permanent Genset</label></div>
							<div class="input"><?php echo $pln['permanent_genset'] == 1 ? 'Yes' : 'No' ?></div>
						</div>
							
						<div class="field">
							<div class="label"><label for="gensetBrand">Genset Brand</label></div>
							<div class="input"><?php echo nbsp($pln['genset_brand']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="gensetCapacity">Genset Capacity (KVA)</label></div>
							<div class="input"><?php echo $pln['genset_capacity'] ?></div>
						</div>
							
						<div class="field">
							<div class="label"><label for="gensetOwnership">Genset Ownership</label></div>
							<div class="input">
								<?php
								$gensetOwnership = get_instance()->core->view_row('t_mtr_genset_ownership', array('genset_ownership_id' => $pln['genset_ownership']));
								echo nbsp(@$gensetOwnership['nama']);
								?>
							</div>
						</div>
					</fieldset>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentPLN -->
		
		<!-- start:contentTower -->
		<div id="contentTower">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($tower) { ?>
					
					<div class="field">
						<div class="label"><label for="kepemilikanTower">Kepemilikan Tower</label></div>
						<div class="input">
							<?php
							$kepemilikanTower = get_instance()->core->view_row('t_mtr_tower_provider', array('tower_provider_id' => $tower['kepemilikan_tower']));
							echo $kepemilikanTower['vendor_id'].'|'.$kepemilikanTower['nama_pemilik_tower'];
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="namaPemilikTower">Nama Pemilik Tower</label></div>
						<div class="input"><?php echo nbsp($tower['nama_pemilik_tower']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="telpPemilikTower">No. Telp Pemilik Tower</label></div>
						<div class="input"><?php echo nbsp($tower['no_telp_pemilik_tower']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="towerType">Tower Type</label></div>
						<div class="input">
							<?php
							$towerType = get_instance()->core->view_row('t_mtr_tower_type', array('tower_type_id' => $tower['tower_type']));
							echo nbsp(@$towerType['tower_type_name']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="towerLegNo">Tower Leg No</label></div>
						<div class="input">
							<?php
							$towerLegNo = get_instance()->core->view_row('t_mtr_tower_leg_no', array('tower_leg_no_id' => $tower['tower_leg_no']));
							echo nbsp(@$towerLegNo['nama']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="towerHeight">Tower Height</label></div>
						<div class="input"><?php echo nbsp($tower['tower_height']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="towerFabricator">Tower Fabricator</label></div>
						<div class="input"><?php echo nbsp($tower['tower_fabricator']) ?></div>
					</div>
					 
					<div class="field">
						<div class="label"><label for="remarks">Remarks</label></div>
						<div class="input"><?php echo nbsp($tower['remarks']) ?></div>
					</div>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentTower -->
		
		<!-- start:contentShelter -->
		<div id="contentShelter">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($shelter) { ?>
					
					<div class="field">
						<div class="label"><label for="kepemilikanShelter">Kepemilikan Shelter</label></div>
						<div class="input">
							<?php
							$kepemilikanShelter = get_instance()->core->view_row('t_mtr_kepemilikan_shelter', array('kepemilikan_shelter_id' => $shelter['kepemilikan_shelter']));
							echo nbsp(@$kepemilikanShelter['descr']);
							?>
						</div>
					</div>
				  
					<div class="field">
						<div class="label"><label for="namaPemilikShelter">Nama Pemilik Shelter</label></div>
						<div class="input"><?php echo nbsp($shelter['nama_pemilik_shelter']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noTelpPemilikShelter">No. Telp Pemilik Shelter</label></div>
						<div class="input"><?php echo nbsp($shelter['no_telp_pemilik_shelter']) ?></div>
					</div>
				  
					<div class="field">
						<div class="label"><label for="shelterType">Shelter Type</label></div>
						<div class="input">
							<?php
							$shelterType = get_instance()->core->view_row('t_mtr_shelter_type', array('shelter_type_id' => $shelter['shelter_type']));
							echo nbsp(@$shelterType['descr']);
							?>
						</div>
					</div>
				
					<div class="field">
						<div class="label"><label for="shelterSize">Shelter Size (LxWxH)</label></div>
						<div class="input"><?php echo nbsp($shelter['shelter_size']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="shelterFabricator">Shelter Fabricator</label></div>
						<div class="input"><?php echo nbsp($shelter['shelter_fabricator']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="remarks">Remarks</label></div>
						<div class="input"><?php echo nbsp($shelter['remarks']) ?></div>
					</div>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentShelter -->
		
		<!-- start:contentLahan -->
		<div id="contentLahan">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($lahan) { ?>
					
					<div class="field">
						<div class="label"><label for="kepemilikanLahan">Kepemilikan Lahan</label></div>
						<div class="input"><?php echo $lahan['kepemilikan_lahan'] == 0 ? 'Beli' : 'Sewa'?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="jenisSuratLahan">Jenis Surat Lahan</label></div>
						<div class="input">
							<?php
							$jenisSuratLahan = get_instance()->core->view_row('t_mtr_jenis_surat_lahan', array('jenis_surat_lahan_id' => $lahan['jenis_surat_lahan']));
							echo nbsp(@$jenisSuratLahan['nama']);
							?>
						</div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noAJB">No. AJB/PKS</label></div>
						<div class="input"><?php echo nbsp($lahan['no_ajb']) ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="dateAJB">Date AJB/PKS</label></div>
						<div class="input"><?php echo nbsp($lahan['date_ajb']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noSuratLahan">No. Surat Lahan</label></div>
						<div class="input"><?php echo nbsp($lahan['no_surat_lahan']) ?></div>
					</div>
					  
					<div class="field">
						<div class="label"><label for="luasLahan">Luas Lahan</label></div>
						<div class="input"><?php echo nbsp($lahan['luas_lahan']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label>Akses Jalan</label></div>
						<div class="input">
							<label>Panjang: <?php echo nbsp($lahan['akses_jalan_pjg']).' X Lebar: '. nbsp($lahan['akses_jalan_lbr']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="sudahBalikNama">Sudah Balik Nama</label></div>
						<div class="input"><?php echo $lahan['sudah_balik_nama'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noBaru">No. Baru</label></div>
						<div class="input"><?php echo nbsp($lahan['no_baru']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="leaseTerm">Lease Term (tahun)</label></div>
						<div class="input"><?php echo nbsp($lahan['lease_term']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="leaseStartDate">Lease Start Date</label></div>
						<div class="input"><?php echo nbsp($lahan['lease_start_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="leaseFinishDate">Lease Finish Date</label></div>
						<div class="input"><?php echo nbsp($lahan['lease_finish_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="namaPemilikLahan">Nama Pemilik Lahan</label></div>
						<div class="input"><?php echo nbsp($lahan['nama_pemilik_lahan']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noTelpPemilikLahan">No. Telp Pemilik Lahan</label></div>
						<div class="input"><?php echo nbsp($lahan['no_telp_pemilik_lahan']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="contactPersonLahan">Contact Person Lahan</label></div>
						<div class="input"><?php echo nbsp($lahan['contact_person_lahan']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="noTelpContactPerson">No. Telp Contact Person</label></div>
						<div class="input"><?php echo nbsp($lahan['no_telp_contact_person']) ?></div>
					</div>
					
					<fieldset>
						<legend>SMG Property</legend>
						<div class="field">
							<div class="label"><label for="status">Status</label></div>
							<div class="input"><?php echo $lahan['status'] == 1 ? 'Yes' : 'No' ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="company">Company</label></div>
							<div class="input"><?php echo nbsp($lahan['company']) ?></div>
						</div>
					</fieldset>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentLahan -->
		
		<!-- start:contentPerijinan -->
		<div id="contentPerijinan">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($perijinan) { ?>
					
					<div class="field">
						<div class="label"><label for="iwNeeded">IW Needed</label></div>
						<div class="input"><?php echo $perijinan['iw_needed'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="iwDate">IW Date</label></div>
						<div class="input"><?php echo nbsp($perijinan['iw_date']) ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="retribusi">Retribusi</label></div>
						<div class="input"><?php echo $perijinan['retribusi'] == 1 ? 'Yes' : 'No' ?></div>
					</div>
					
					<div class="field">
						<div class="label"><label for="biayaRetribusi">Biaya Retribusi</label></div>
						<div class="input"><?php echo nbsp(number_format((int) $perijinan['biaya_retribusi'], 2)) ?></div>
					</div>
					
					<fieldset>
						<legend>HO Info</legend>
						
						<div class="field">
							<div class="label"><label for="hoNumber">HO Number</label></div>
							<div class="input"><?php echo nbsp($perijinan['ho_number']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="hoDate">HO Date</label></div>
							<div class="input"><?php echo nbsp($perijinan['ho_date']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="hoExpired">HO Expired</label></div>
							<div class="input"><?php echo nbsp($perijinan['ho_expired']) ?></div>
						</div>
					</fieldset>
					
					<fieldset>
						<legend>PBB</legend>
						
						<div class="field">
							<div class="label"><label for="nomorPBB">Nomor PBB</label></div>
							<div class="input"><?php echo nbsp($perijinan['nomor_pbb']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="atasNama">Atas Nama</label></div>
							<div class="input"><?php echo nbsp($perijinan['atas_nama']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="jatuhTempo">Jatuh Tempo</label></div>
							<div class="input"><?php echo nbsp($perijinan['jatuh_tempo']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="nilaiPBB">Nilai PBB</label></div>
							<div class="input"><?php echo nbsp($perijinan['nilai_pbb']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="picPBB">PIC PBB</label></div>
							<div class="input">
								<?php
								$picPBB = get_instance()->core->view_row('t_mtr_pic_pbb', array('pic_pbb_id' => $perijinan['pic_pbb']));
								echo nbsp(@$picPBB['descr']);
								?>
							</div>
						</div>
					</fieldset>
					
					<fieldset>
						<legend>IMB</legend>
						
						<div class="field">
							<div class="label"><label for="nomorIMB">Nomor IMB</label></div>
							<div class="input"><?php echo nbsp($perijinan['nilai_pbb']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="imbDate">Date</label></div>
							<div class="input"><?php echo nbsp($perijinan['date']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="imbExpired">Expired</label></div>
							<div class="input"><?php echo nbsp($perijinan['expired']) ?></div>
						</div>
					</fieldset>
					
					<fieldset>
						<legend>Rekomendasi Ketinggian Tower (RKT)</legend>
						
						<div class="field">
							<div class="label"><label for="rktNumber">RKT Number</label></div>
							<div class="input"><?php echo nbsp($perijinan['rkt_number']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="rktDate">RKT Date</label></div>
							<div class="input"><?php echo nbsp($perijinan['rkt_date']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="remarks">Remarks</label></div>
							<div class="input"><?php echo nbsp($perijinan['remarks']) ?></div>
						</div>
					</fieldset>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentPerijinan -->
		
		<!-- start:contentTenancy -->
		<div id="contentTenancy">
			
			<div class="form">
				<div class="fields">
					
					<?php if ($tenancy_sell || $tenancy_buy) { ?>
					
					<fieldset>
						<legend>Colloc Sell</legend>
						
						<div class="field">
							<div class="label"><label for="availableForRent">Available for Rent</label></div>
							<div class="input"><?php echo @$tenancy['sell']['available_for_rent'] == 1 ? 'Yes' : 'No' ?></div>
						</div>
						
						<?php
						if ($tenancy_sell) {
							$i = 1;
							foreach ($tenancy_sell as $sell) {
								$loop = '';
								if ($i == 1) {
									$loop = $i.'st';
								} elseif ($i == 2) {
									$loop = $i.'nd';
								} elseif ($i == 3) {
									$loop = $i.'rd';
								} else {
									$loop = $i.'th';
								}
						?>
						<div class="field">
							<div class="label"><label for="tenant1stColloc">Tenant <?php echo $loop ?></label></div>
							<div class="input">
								<?php
								$tenant = get_instance()->core->view_row('t_mtr_tenant', array('tenant_id' => $sell['tenant_id']));
								echo nbsp($tenant['tenant_name'])
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="tenant1stDateColloc">Tenant <?php echo $loop ?> Date</label></div>
							<div class="input"><?php echo nbsp($sell['tenancy_date']) ?></div>
						</div>						
						
						<?php
								$i++;
							}
						}
						?>
						
					</fieldset>
					
					<fieldset>
						<legend>Colloc Buy</legend>
						
						<div class="field">
							<div class="label"><label for="seqNumberOfTenant">Seq. Number of Tenant</label></div>
							<div class="input"><?php echo @nbsp($tenancy['buy']['seq_number_tenant']) ?></div>
						</div>
						
						<?php
						if ($tenancy_buy) {
							$i = 1;
							foreach ($tenancy_buy as $buy) {
								$loop = '';
								if ($i == 1) {
									$loop = $i.'st';
								} elseif ($i == 2) {
									$loop = $i.'nd';
								} elseif ($i == 3) {
									$loop = $i.'rd';
								} else {
									$loop = $i.'th';
								}
						?>
						
						<div class="field">
							<div class="label"><label for="tenant1stBuy">Tenant <?php echo $loop ?></label></div>
							<div class="input">
								<?php
								$tenant = get_instance()->core->view_row('t_mtr_tenant', array('tenant_id' => $buy['tenant_id']));
								echo nbsp($tenant['tenant_name'])
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="tenant1stDateBuy">Tenant <?php echo $loop ?> Date</label></div>
							<div class="input"><?php echo nbsp($buy['tenancy_date']) ?></div>
						</div>
						
						<?php
								$i++;
							}
						}
						?>
						
					</fieldset>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentTenancy -->
		
		<!-- start:contentAC -->
		<div id="contentAC">
			
			<div class="form">
				<div class="fields">
				
					<?php if ($ac) { ?>
					
					<fieldset>
						<legend>AC1</legend>
						
						<div class="field">
							<div class="label"><label for="brandAC1">Brand</label></div>
							<div class="input">
								<?php
								$brandAC1 = get_instance()->core->view_row('t_mtr_ac_brand', array('ac_brand_id' => $ac['ac1_brand']));
								echo nbsp(@$brandAC1['nama']);
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="typeAC1">Type / Model</label></div>
							<div class="input"><?php echo nbsp($ac['ac1_type']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="capacityAC1">Capacity</label></div>
							<div class="input">
								<?php
								$capacity1 = get_instance()->core->view_row('t_mtr_ac_capacity', array('ac_capacity_id' => $ac['ac1_capacity']));
								echo nbsp(@$capacity1['nama']);								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="serialNumberAC1">Serial Number</label></div>
							<div class="input"><?php echo nbsp($ac['ac1_serial']) ?></div>
						</div>
					</fieldset>
					
					<fieldset>
						<legend>AC2</legend>
						
						<div class="field">
							<div class="label"><label for="brandAC2">Brand</label></div>
							<div class="input">
								<?php
								$brandAC2 = get_instance()->core->view_row('t_mtr_ac_brand', array('ac_brand_id' => $ac['ac2_brand']));
								echo nbsp(@$brandAC2['nama']);
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="typeAC2">Type / Model</label></div>
							<div class="input"><?php echo nbsp($ac['ac2_type']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="capacityAC2">Capacity</label></div>
							<div class="input">
								<?php
								$capacity2 = get_instance()->core->view_row('t_mtr_ac_capacity', array('ac_capacity_id' => $ac['ac2_capacity']));
								echo nbsp(@$capacity2['nama']);
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="serialNumberAC2">Serial Number</label></div>
							<div class="input"><?php echo nbsp($ac['ac2_serial']) ?></div>
						</div>
					</fieldset>
					
					<fieldset>
						<legend>AC3</legend>
						
						<div class="field">
							<div class="label"><label for="brandAC3">Brand</label></div>
							<div class="input">
								<?php
								$brandAC3 = get_instance()->core->view_row('t_mtr_ac_brand', array('ac_brand_id' => $ac['ac3_brand']));
								echo nbsp(@$brandAC3['nama']);
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="typeAC3">Type / Model</label></div>
							<div class="input"><?php echo nbsp($ac['ac3_type']) ?></div>
						</div>
						
						<div class="field">
							<div class="label"><label for="capacityAC3">Capacity</label></div>
							<div class="input">
								<?php
								$capacityAC3 = get_instance()->core->view_row('t_mtr_ac_capacity', array('ac_capacity_id' => $ac['ac3_capacity']));
								echo nbsp(@$capacityAC3['nama']);
								?>
							</div>
						</div>
						
						<div class="field">
							<div class="label"><label for="serialNumberAC3">Serial Number</label></div>
							<div class="input"><?php echo nbsp($ac['ac2_serial']) ?></div>
						</div>
					</fieldset>
					
					<div class="field">
						<div class="label"><label for="remarks">Remarks</label></div>
						<div class="input"><?php echo nbsp($ac['remarks']) ?></div>
					</div>
					
					<?php } ?>
					
				</div>
			</div>
			
		</div>
		<!-- end:contentAC -->
	
	</div>
	<!-- end:siteInfo -->
	
</div>


<script>
var tabbar = new dhtmlXTabBar("siteInfo", "top");
tabbar.setSkin('dhx_skyblue');
tabbar.setImagePath("<?php echo base_url('/assets/js/dhtmlx/dhtmlxTabbar/imgs') ?>/");
tabbar.enableAutoSize(false, true);
tabbar.enableAutoReSize(true);
tabbar.addTab("tabGeneralInfo", "General Info", "100px");
tabbar.addTab("tabSiteKeepers", "Site Keepers", "100px");
tabbar.addTab("tabPLN", "Power(PLN)", "100px");
tabbar.addTab("tabTower", "Tower", "100px");
tabbar.addTab("tabShelter", "Shelter", "100px");
tabbar.addTab("tabLahan", "Space", "100px");
tabbar.addTab("tabPerijinan", "Permission", "100px");
tabbar.addTab("tabTenancy", "Tenancy", "100px");
tabbar.addTab("tabAC", "Air Conditioner (AC)");
tabbar.setContent("tabGeneralInfo", "contentGeneralInfo");
tabbar.setContent("tabSiteKeepers", "contentSiteKeepers");
tabbar.setContent("tabPLN", "contentPLN");
tabbar.setContent("tabTower", "contentTower");
tabbar.setContent("tabShelter", "contentShelter");
tabbar.setContent("tabLahan", "contentLahan");
tabbar.setContent("tabPerijinan", "contentPerijinan");
tabbar.setContent("tabTenancy", "contentTenancy");
tabbar.setContent("tabAC", "contentAC");
tabbar.setTabActive("tabGeneralInfo");
tabbar.attachEvent("onSelect", function(id, last_id) {
	var alertError = document.getElementsByClassName('message-error');
	for (var i = 0; i < alertError.length; i++) {
		alertError[i].parentNode.removeChild(alertError[i]);
	}
	
	var alertSuccess = document.getElementsByClassName('message-success');
	for (var i = 0; i < alertSuccess.length; i++) {
		alertSuccess[i].parentNode.removeChild(alertSuccess[i]);
	}
	
	return true;
});
</script>

<script><!--

var formSubmit = function(form) {
	
	<?php if (get_instance()->uri->segment(2) == 'add') { ?>
	var url = '<?php echo site_url('/site_info/add') ?>';
	<?php } else { ?>
	var url = '<?php echo site_url('/site_info/edit/'.get_instance()->uri->segment(3)) ?>';
	<?php } ?>
	
	$.ajax({
		url: url,
		data: $(form).serialize(),
		type: 'POST',
		dataType: 'json',
		success: function(json) {
			var alertError = document.getElementsByClassName('message-error');
			for (var i = 0; i < alertError.length; i++) {
				alertError[i].parentNode.removeChild(alertError[i]);
			}
			
			var alertSuccess = document.getElementsByClassName('message-success');
			for (var i = 0; i < alertSuccess.length; i++) {
				alertSuccess[i].parentNode.removeChild(alertSuccess[i]);
			}
			
			var siteId = document.getElementsByName('siteId');
			for (var i = 0; i < siteId.length; i++) {
				siteId[i].value = json['site_id'];
			}
		
			if (json['error']) {
				var message = '\
					<div class="message-error" style="padding:10px; margin-bottom:10px;">';
						message += '<ul>';
						for (var i = 0; i < json['message'].length; i++) {
							message += '<li>' + (i + 1) + '. ' + json['message'][i] + '</li>';
						}
						message += '</ul>';
					message += '</div>';
				
				$('#siteInfo').prepend(message);
				$('#siteInfo').css('height', 'auto');
			} else {
				var message = '\
					<div class="message-success" style="padding:10px; margin-bottom:10px;">' + json['message'] + '</div>';
				
				$('#siteInfo').prepend(message);
				$('#siteInfo').css('height', 'auto');
			}
		}
	});
};

//--></script>

<script><!--

$(function() {
	
	$('#cmePartnerName').autocomplete({
		minLength: 2,
      	source: function(req, resp) {
			$.ajax({
				url: '<?php echo site_url('/site_info/add') ?>',
				dataType: 'json',
				type: 'GET',
				data: { cmd: 'GET_CME_PARTNER', key: req.term },
				beforeSend: function() {
					//$('input[name="merchantBranchName"]').after('<span id="loading" class="price"><img src="<?php echo base_url('/assets/images/loading.gif') ?>" /></span>');
				},
				success: function(json) {
					resp(json.data);
				},
				complete: function() {
					//$('#loading').remove();
				}
			});
		},
		open: function(e,ui) {
            var  acData = $(this).data('autocomplete');
			var termTemplate = '<strong>%s</strong>';
            
			acData.menu.element.find('a').each(function() {
                var me = $(this);
                var regex = new RegExp(acData.term, "gi");
                me.html( me.text().replace(regex, function (matched) {
                    return termTemplate.replace('%s', matched);
                }) );
            });
        },
		select: function(event, ui) {
			document.getElementsByName('cmePartner')[0].value = ui.item.id;
		},
		change: function(event, ui) {
			if (ui.item.id == '') {
				document.getElementById('cmePartnerName').value = '';
			}
		}
	});
	
});


var input = document.getElementsByTagName('input');
for (var i = 0; i < input.length; i++) {
	if (input[i].type == 'text') {
		input[i].setAttribute('autocomplete', 'off');
	}
}

//--></script>

<script src="<?php echo base_url('/assets/js/number_format.js') ?>"></script>
<script><!--
var currency = document.getElementsByClassName('currency');
var number = document.getElementsByClassName('number');

var currencyOnSubmit = function() {
	for (var i = 0; i < currency.length; i++) {
		var prec = currency[i].value.split('.');
		if (prec[1] == '00') {
			currency[i].value = number_format(currency[i].value, '', '', '');
		} else {
			currency[i].value = number_format(currency[i].value, 2, '.', '');
		}
	}
};

var numberOnSubmit = function() {
	for (var i = 0; i < number.length; i++) {
		var prec = number[i].value.split('.');
		if (prec[1] == '00') {
			number[i].value = number_format(number[i].value, '', '', '');
		} else {
			number[i].value = number_format(number[i].value, 2, '.', '');
		}
	}
};

for (var i = 0; i < currency.length; i++) {
	// load default
	currency[i].value = number_format(currency[i].value, 2);
	
	// onfocus
	currency[i].onfocus = function() {
		var prec = this.value.split('.');
		if (prec[1] == '00') {
			this.value = number_format(this.value, '', '', '');
		} else {
			this.value = number_format(this.value, 2, '.', '');
		}
	}
	
	// onblur
	currency[i].onblur = function(e) {
		if (!isNumeric(this.value)) { 
			alert('Please enter only numbers or decimal points.'); 
			setTimeout(function() { e.target.focus() });
			return false; 
		} 
		
		this.value = number_format(this.value, 2);
	}
}

for (var i = 0; i < number.length; i++) {
	// load default
	number[i].value = number_format(number[i].value, 2, '.', '');
	
	// onfocus
	number[i].onfocus = function() {
		var prec = this.value.split('.');
		if (prec[1] == '00') {
			this.value = number_format(this.value, '', '', '');
		} else {
			this.value = number_format(this.value, 2, '.', '');
		}
	}
	
	// onblur
	number[i].onblur = function(e) {
		if (!isNumeric(this.value)) { 
			alert('Please enter only numbers or decimal points.'); 
			setTimeout(function() { e.target.focus() });
			return false; 
		}
		
		this.value = number_format(this.value, 2, '.', '');
	}
}

var isNumeric = function(sText) {
	var validChars = "0123456789.";
	var isNumber = true;
	var character;
 
	for (var i = 0; i < sText.length && isNumber == true; i++) { 
		character = sText.charAt(i);
		if (validChars.indexOf(character) == -1) {
			isNumber = false;
		}
	}
	
	return isNumber;
};
//--></script>